% Chapter 1

\chapter{Fundamentals} % Main chapter title

\label{Chapter1} % For referencing the chapter elsewhere, use \ref{Chapter1} 

\lhead{Chapter 1. \emph{Fundamentals}} % This is for the header on each page - perhaps a shortened title

%----------------------------------------------------------------------------------------

\section{Introduction}
With the rapid development of processing and storage technologies and the success of the Internet, computing resources have become cheaper, more powerful and more ubiquitously available than ever before. This technological trend has enabled the realization of a new computing model called Cloud computing, in which resources (e.g., CPU and storage) are provided as general utilities that can be leased and released by users through the Internet in an on-demand fashion. The objective of this chapter is provide an introductory information about the Cloud computing.

%Firstly, different definitions of cloud computing will be listed in order take the best one that fulfill the all essential aspects. Related and enabling technologies are presented in order to clarified the adopted cloud computing definition. 
Firstly, a definition of cloud computing is given. Related and enabling technologies are presented in order to clarified the adopted cloud computing definition. 
Architectural aspects of cloud computing are also studied and the different layers and types of services are explained with the purpose of understand how the cloud computing is organized.

Secondly, the deployment models and a list of essential characteristics are studied in order to clarified which features allow cloud computing takes distance from traditional services computing. 

%Finally, a survey of the most dominant cloud computing platforms are presented.

%----------------------------------------------------------------------------------------

\section{Cloud computing}

In common usage, the term ``the cloud'' is essentially a metaphor for the Internet. However, the main idea behind Cloud computing is not a new one. John McCarthy in the 1960s already envisioned that computing facilities will be provided to the general public like a utility \citep{Reference1}. The term “cloud” has also been used in various contexts such as describing large ATM networks in the 1990s. However, it was after Google’s CEO Eric Schmidt used the word to describe the business model of providing services across the Internet in 2006, that the term really started to gain popularity. Since then, the term Cloud computing has been used mainly as a marketing term in a variety of contexts to represent many different ideas. Basically, cloud computing makes data and applications available through the Internet. By doing this, data and applications can be accessed from everywhere.

With cloud computing it becomes easier to access data with several devices. Especially for mobile devices this can be really useful since the only thing that is needed is an Internet connection. The Figure \ref{fig:cloud_computing_diagram} shows a general cloud computing diagram.


\begin{figure}[htbp]
	\centering
		\includegraphics[width=0.6\textwidth]{Figures/cloud_computing_diagram.png}
		\rule{30em}{0.5pt}
	\caption[Cloud computing diagram]{Cloud computing diagram}
	\label{fig:cloud_computing_diagram}
\end{figure} 


\subsection{Definition}  

There are several definitions of the Cloud computing \citep{Reference2}. In this thesis, we adopt the definition of Cloud computing provided by The National Institute of Standards and Technology (NIST) \citep{Reference3} because it cover the all essential aspects of the Cloud computing:

\textbf{Definition of Cloud computing:} \textit{Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.}

In order to facilitate the clear understanding of the Cloud computing, is necessary compare Cloud computing with other existing computing paradigms: Cluster computing and Grid computing.

 \begin{itemize}
 \item \textbf{Cluster computing:} Cluster computing refers to the technology in which computer clusters are created. A cluster is a type of parallel and distributed system, which consists of a collection of inter-connected stand-alone computers working together as a single integrated computing resource \citep{Reference4}.
 \item \textbf{Grid computing:} Grid computing is a distributed computing paradigm that coordinates networked resources to achieve a common computational objective. Cloud computing is similar to Grid computing in that it also employs distributed resources to achieve application-level objectives. However, cloud computing takes one step further by leveraging virtualization technologies at multiple levels (hardware and application platform) to realize resource sharing and dynamic resource provisioning \citep{Reference5}.
\end{itemize}

\section{Enabling technologies}

There are different related technologies that made the Cloud computing realizable.
 
\subsection{Utility computing} 

Represents the model of providing resources on-demand and charging customers based on usage rather than a flat rate. Cloud computing can be perceived as a realization of utility computing. It adopts a utility-based pricing scheme entirely for economic reasons. With on-demand resource provisioning and utility-based pricing, service providers can truly maximize resource utilization and minimize their operating costs \citep{Reference5}.

\subsection{Virtualization} 

Virtualization is a technology that abstracts away the details of physical hardware and provides virtualized resources for high-level applications. A virtualized server is commonly called a virtual machine (VM). Virtualization forms the foundation of cloud computing, as it provides the capability of pooling computing resources from clusters of servers and dynamically assigning or reassigning virtual resources to applications on-demand. With virtualization, applications and infrastructure are independent, allowing servers to be  easily  shared  by  many  applications  where  applications  are  running  virtually  anywhere in the world \citep{Reference5}.

\subsection{Automatic computing} 

Originally coined by IBM in 2001, autonomic computing aims at building computing systems capable of self-management, i.e. reacting to internal and external observations without human intervention. The goal of autonomic computing is to overcome the management complexity of today’s computer systems. Although cloud computing exhibits certain autonomic features such as automatic resource provisioning, its objective is to lower the resource cost rather than to reduce system complexity \citep{Reference5}.

\subsection{Load balancer} 

Load balancing is the key to success for cloud architectures. It is capable of distributing the working processes evenly between 2 or more computers, so that resources can be used efficiently and therefore increases performance and availability \citep{Reference6}. 

In summary, Cloud computing leverages virtualization technology to achieve the goal of providing computing resources as a utility. It shares certain aspects with grid computing and autonomic computing but differs from them in other aspects. Therefore, it offers unique benefits and imposes distinctive challenges to meet its requirements.

%----------------------------------------------------------------------------------------

\section{Layers in Cloud computing}

The architecture of the Cloud computing can be divided into 5 layers. Three of them (Infrastructure, Platform and Application)are offered as a services, but additionally there are two layer: The Hardware layer, witch is owned and operated of the cloud services provider and finally the Client layer is supplied by the end users \citep{Reference20}. The 5 layer are shown in the Figure \ref{fig:CloudCA}.

\begin{figure}[htbp]
	\centering
		\includegraphics[width=0.6\textwidth]{Figures/cloud_computing_layers.png}
		\rule{35em}{0.5pt}
	\caption[Cloud computing layers]{Cloud computing layers.}
	\label{fig:CloudCA}
\end{figure} 


\textbf{The Hardware layer:} This layer is responsible for managing the physical resources of the cloud, including physical servers, routers, switches, power and cooling systems. In practice, the hardware layer is typically implemented in data centers. A data center usually contains thousands of servers that are organized in racks and interconnected through switches, routers or other fabrics. Typical issues at hardware layer include hardware configuration, fault tolerance, traffic management, power and cooling resource management.

\textbf{The Infrastructure layer:} Also known as the virtualization layer, the infrastructure layer creates a pool of storage and computing resources by partitioning the physical resources using virtualization technologies such as Xen \citep{Reference21}, KVM \citep{Reference22} and VMware \citep{Reference23}. The infrastructure layer is an essential component of cloud computing, since many key features, such as dynamic resource assignment, are only made available through virtualization technologies. 

\textbf{The Platform layer:} Built on top of the infrastructure layer, the platform layer consists of operating systems and
application frameworks. The purpose of the platform layer is to minimize the burden of deploying applications directly into VM containers. For example, Google App Engine operates at the platform layer to provide API support for implementing storage, database and business logic of typical web applications.

\textbf{The Application layer:} At the highest level of the hierarchy, the application layer consists of the actual cloud applications. Different from traditional applications, cloud applications can leverage the automatic-scaling feature to achieve better performance, availability and lower operating cost.

\textbf{The Client layer:} While this layer is not a cloud computing service, it is an essential part of the model. The client layer acts as the user interface to which cloud computing services are delivered. Client layer hardware can include personal computers, web browsers, mobile devices, and even telephones \citep{Reference20}.

Compared to traditional service hosting environments such as dedicated server farms, the architecture of cloud computing is more modular. Each layer is loosely coupled with the layers above and below, allowing each layer to evolve separately. This is similar to the design of the OSI model for network protocols. The architectural modularity allows cloud computing to support a wide range of application requirements while reducing management and maintenance overhead.

\section{Service Models}

Cloud computing employs a service-driven business model. In other words, hardware and platform-level resources are provided as services on an on-demand basis. Conceptually, every layer of the architecture described in the previous section can be implemented as a service to the layer above. Conversely, every layer can be perceived as a customer of the layer below. Service providers deliver their services according to three fundamental models: Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS). IaaS is supposed to be the most basic version and when moving to the other versions, an organization, which is buying the solution, has to be concerned about fewer details. So with an IaaS solution an organization has to consider operating systems and applications and in SaaS they can just consume the
service of the software. The Figure \ref{fig:CCBussinesModel} shows the three technology capabilities offered under the name of cloud computing and three companies that currently offer those technology solutions. 

\begin{figure}[htbp]
	\centering
		\includegraphics[width=0.6\textwidth]{Figures/CCserviceModel.png}
		\rule{35em}{0.5pt}
	\caption[Cloud computing service models]{Cloud computing service models.}
	\label{fig:CCBussinesModel}
\end{figure} 

\subsection{Infrastructure as a Service (IaaS)} 
IaaS refers to on-demand provisioning of infrastructural resources, usually in terms of VMs. The cloud owner who offers IaaS is called an IaaS provider. Examples of IaaS providers include Amazon EC2 \citep{Reference12}, GoGrid \citep{Reference13} and Flexiscale \citep{Reference14}. Providers with this service model have large amounts of storage and processing power which they supply on demand. The customers of these providers can install some operating system images as well as applications. By doing this, the customer has a lot of freedom to create his own environment.
Instead of investing in their own corporate server or network infrastructure, companies are able to purchase those resources on a rental basis and use it on demand rather than having their own resources locally. The providers are taking care of the servers, storage and  network  settings,  while  the  client  has  virtual  instances  of  that. Amazon Web Services is one example of that, where infrastructure is available on a pay-per-use  self  service  basis  and  get  servers,  storage,  network  configuration,  set  all that up and run it, while not having to worry about collocation, rental or datacenters \citep{Reference12}.

\subsection{Platform as a Service (PaaS)} PaaS refers to providing platform layer resources, including operating system support, software development frameworks, programming language execution environments, databases and web servers. The customer still has to develop its own applications which than can be run on the platform. This means that this solution will be suitable for developers. Examples of PaaS providers include Google App Engine \citep{Reference11} and Microsoft Windows Azure \citep{Reference15}.

Since applications are being developed for a specific platform, it might be the case that those applications will run on this platform only. When this happens it will be hard to switch from provider because in that situation it will be necessary to develop existing applications for the new platform again.

\subsection{Software as a Service (SaaS)} 
SaaS refers to providing on demand applications over the Internet. The customer does not have to manage the infrastructure or platform.  For the provider of the application it is easier to maintain because it does not have to be done for every customer separately. Since the SaaS solution offers applications, the end user will be able to work with this immediately. Companies can use software that is made available online on a rental or usage basis rather than buying the whole software package locally without being sure whether or not the investment will pay off on a long-term basis. Examples of SaaS providers include Salesforce.com \citep{Reference16}, Rackspace \citep{Reference17} and SAP Business ByDesign \citep{Reference18}.
As an example, Google Apps offer software for business or private entities online that can do the fundamental business action that a usual on-premise office suite can provide. Google Apps involve document collaboration within text documents, presentation and spreadsheets as much as calendars and email services \citep{Reference19}.

The below table shows a general comparison among the three type of services:

\begin{table}[!hbt]
\begin{center}
\begin{tabular}{|p{2cm} |p{3cm} |p{4cm} |p{4cm}|}
\hline
& \textbf{IaaS} & \textbf{PaaS} & \textbf{SaaS} \\
\hline
User & Network Architecture & Developer & End User\\
\hline
Advantages & All control and high security & No concerns operating systems & The software requires no client installation. Reduce time and cost of development. No maintenance.\\
\hline
\end{tabular}
\caption{Comparison of service models}
\end{center}
\end{table}


\section{Deployment Models}

Clouds  can  be  defined  as  computers  that  are  networked anywhere in the world with the availability of paying the used clouds in a pay-per-use way, meaning that just the resources that are being used will be paid. There are different deployment models for implementing a cloud based solution:

\subsection{Public cloud}  A cloud in which service providers offer their resources as services to the general public. Public clouds offer several key benefits to service providers, including no initial capital investment on infrastructure and shifting of risks to infrastructure providers. However, public clouds lack fine-grained control over data, network and
security settings. The advantages of the public cloud are that the customer does not have to buy any equipment and that the resources can be shared among different customers and the cost can go down because the equipment is used in more efficiently.

\subsection{Private cloud} Private clouds are normally datacenters that are used in a private network and can therefore restrict the unwanted public to access the data that is used by the company, but the hardware for the private cloud can be located either on-premise or in a data center of the vendor. The advantages of this model is that an organization has total control over the hardware and that the organization has to worry less about the security since no other organizations are using the hardware. An organization can choose to buy the hardware itself or use a CSP (Cloud Service Provider) instead. The downside of not using a CSP is that the hardware still has to be bought which results in higher costs. Furthermore the buying of the hardware results in the fact that there will still be a limit on computational power and storage. So this means that the organization still has to buy those resources based on the peak-load.

\subsection{Hybrid cloud} A hybrid cloud is a combination of public and private cloud models that tries to address the limitations of each approach. In a hybrid cloud, part of the service infrastructure runs in private clouds while the remaining part runs in public clouds. Hybrid clouds offer more flexibility than both public and private clouds. For example, an organization can keep its business critical information inside the organization and run other processes outside the organization. Another possibility is that an organization runs all the applications in its private cloud and only uses the public cloud when the private cloud lacks for example computational power. The downside of this model is that the efficiency will be somewhat lower than the efficiency of public cloud.

\subsection{Community cloud} The cloud infrastructure is provisioned for exclusive use by a specific community  of  consumers  from organizations that have shared concerns (e.g.,  mission, security requirements, policy, and compliance considerations). It may be owned, managed, and operated by one or more of the organizations in the community, a third party, or some combination of them, and it may exist on or off premises. The main advantage of the community cloud is that the cost can be spread over the community. But the disadvantages of the private cloud are also spread over this kind of cloud.

The following table shows the main advantages and disadvantages among all four cloud computing types:

\begin{table}[!hbt]
\begin{center}
\begin{tabular}{|p{2.5cm} |p{5.5cm} |p{5.5cm}|}
\hline
& \textbf{Advantages} & \textbf{Disadvantages} \\
\hline
Public & No need to buy hardware. Equipment is used in more efficiently. & Data is stored off-premise.\\
\hline
Private & Control over hardware and data. & Hardware needs to be bought or leased.\\
\hline
Hybrid & Business critical information can stay on-premise. & Less efficient than public solution.\\
\hline
Community & Cost can be spread. & Hardware needs to be bought or leased.\\
\hline
\end{tabular}
\caption{Comparison of deployment models}
\end{center}
\end{table}

The Figure \ref{fig:overviewTypeOfCloud} shows an overview of cloud computing types.

\begin{figure}[htbp]
	\centering
		\includegraphics[width=0.6\textwidth]{Figures/cloud_computing_types.png}
		\rule{35em}{0.5pt}
	\caption[Cloud computing Types]{Cloud computing Types.}
	\label{fig:overviewTypeOfCloud}
\end{figure}

\subsection{Virtual private cloud} An alternative solution of the both public and private cloud is called Virtual Private Cloud (VPC). A VPC is essentially a platform running on top of public clouds. The main difference is that a VPC leverages virtual private network (VPN) technology that allows service providers to design their own topology and security settings such as firewall rules \citep{Reference5}.

\section{Cloud computing characteristics}

Cloud computing provides several features that are different from traditional services computing:

\textbf{On-demand self-service:} A consumer can unilaterally provision computing capabilities, such as server time and network storage, as needed automatically without requiring human interaction with each service provider \citep{Reference3}.

\textbf{Broad network access:} Capabilities are available over the network and accessed through standard mechanisms that promote use by heterogeneous thin or thick client platforms (e.g., mobile phones, tablets, laptops, and workstations) \citep{Reference3}.

\textbf{Multi-tenancy:} In a cloud environment, services owned by multiple providers are co-located in a single data center. The performance and management issues of these services are shared among service providers and the infrastructure provider. The layered architecture of cloud computing provides a natural division of responsibilities: the owner of each layer only needs to focus on the specific objectives associated with this layer \citep{Reference5}.

\textbf{Resource pooling:} The provider’s computing resources are pooled to serve multiple consumers using a multi-tenant model, with different physical and virtual resources dynamically assigned and reassigned according to consumer demand. There is a sense of location independence in that the customer generally has no control or knowledge over the exact location of the provided resources but may be able to specify location at a higher level of abstraction (e.g., country, state, or datacenter). Examples of resources include storage, processing, memory, and network bandwidth \citep{Reference3}.

\textbf{Rapid elasticity:} Capabilities can be elastically provisioned and released, in some cases automatically, to scale rapidly outward and inward commensurate with demand. To the consumer, the capabilities available for provisioning often appear to be unlimited and can be appropriated in any quantity at any time \citep{Reference3}.

\textbf{Geo-distribution:} Clouds are generally accessible through the Internet and use the Internet as a service delivery network. Hence any device with Internet connectivity, is able to access cloud services. Additionally, to achieve high network performance and localization, many of today’s clouds consist of data centers located at many locations around the globe \citep{Reference5}. 

\textbf{Service oriented:} cloud computing adopts a service-driven operating model. In a cloud, each IaaS, PaaS and SaaS provider offers its service according to the Service Level Agreement (SLA) negotiated with its customers. SLA assurance is therefore a critical objective of every provider \citep{Reference5}.

\textbf{Utility-based pricing:} Cloud computing employs a pay-per-use pricing model. The exact pricing scheme may vary from service to service. For example, a SaaS provider may rent a virtual machine from an IaaS provider on a per-hour basis \citep{Reference5}. 

\textbf{Measurable service:} Cloud systems automatically control and optimize necessary resources depending on the needs of users and required types of services (disk space, power of processor, amount of RAM and so on). All these services are measurable and their usage is transparent, both for the provider and  clients \citep{Reference3}.


\section{Strengths of the Cloud computing}

Cloud computing is supposed to give many advantages to cloud providers as well as clients. Below some advantages of the cloud computing are listed:

\textbf{Low cost:} For the clients an advantage is that they do not have to buy the hardware and software anymore since it is no longer a product but a service. It reduces the capital expenditure of a company and transform it in operational costs. This advantage manifests by renting rather than buying infrastructure using the pay-per-use model offered by many Cloud providers. Cloud computing furthermore results in the fact that the IT department does not have to provide the end-users with resources because the provision of those resources will be done automatically by the cloud service provider. 

\textbf{Maintenance of software/infrastructure:} It will be easier to maintain applications in the cloud since there is no need to install it on every single computer or server within a specific organization. Furthermore it will be easier to change an organization’s infrastructure because there is no privately owned hardware involved. 

\textbf{Easy access:} A cloud solution is also device and location independent because everything is running online. Because of this it is possible to use those applications on any device that has Internet access. 

\textbf{Easy resource sharing:} By using virtualization it is very easy to share servers and storage. By doing this the equipment will be used more efficiently.

\textbf{Increasing the storage, scalability and elasticity:} Buyers of cloud based solutions do not have to consider their peak load because there is more than enough capacity in the cloud. Once the peak is over, the resources can be scaled down again. In the cloud, applications can run on multiple servers so this will increase the reliability of the service as well. 

%High availability. \textbf{missing}

%Better performance of the application in general. \textbf{missing}
 

%\section{Cloud platforms}
%
%In this section, some of the dominant cloud computing products are studied.
%
%\subsection{Amazon Web Services (AWS)}
%
%AWS can be characterized as “Infrastructure as a Service”. This means that Amazon provides basic computing capability – a virtual machine container, reliable and redundant storage, and high performance networking – in a remote location. Users 
%have no need to provision or pay for local hardware infrastructure – Amazon takes care of that. Users focus on the software assets – the application – that resides upon and uses AWS computing resources \citep{Reference5}.
%
%AWS is comprised of a number of individual services. Some of them as listed below:
%
%\textbf{Elastic Compute Cloud (Amazon EC2):} EC2 provides elastic computing capacity. In essence, EC2 provides empty virtual machines into which users install desired software assets: operating system, middleware, and application(s).  Amazon EC2 enables
%cloud users to launch and manage server instances in data centers using APIs or available tools and utilities. After creating and starting an instance, users can upload software and make changes to it. When changes are finished, they can be bundled as a new machine image. Users have nearly full control of the entire software stack on the EC2 instances that look like hardware to them.
%
%\textbf{Simple Storage Service (Amazon S3):} S3 provides the ability to store any amount of desired data in a reliable fashion. It's important to understand that S3 data is unstructured \citep{Reference5}. S3 store data as “objects” that are grouped in “buckets.” Each object contains from 1 byte to 5 terabytes. Object names are essentially URI pathnames. Buckets must be explicitly created before they can be used. A bucket can be stored in one of several Regions. Users can choose a Region to optimize latency, minimize costs, or address regulatory requirements \citep{Reference8}.
%
%\textbf{Amazon Virtual Private Cloud (VPC):} With Amazon VPC a company can provisions a private, isolated section of the Amazon Web Services (AWS) cloud where the company can launch AWS resources in a virtual network that it defines. With Amazon VPC, is possible define a virtual network topology that closely resembles a traditional network that any company might operate in its own data center. The customer has complete control over its virtual networking environment, including selection of its own IP address range, creation of subnets, and configuration of route tables and network gateways \citep{Reference9}.
%
%\subsection{Microsoft Windows Azure platform} 
%
%Windows Azure is a cloud platform from Microsoft. With this platform it is possible to build, host and scale web applications, therefore it is classified “Platform as a Service”. 
%Microsoft Windows Azure platform consists of three components and each of them provides a specific set of services to cloud users. 
%
%\textbf{Windows Azure:} Provides a Windows-based environment for running applications and storing data on servers in data centers. Windows Azure platform can be used both by applications running in the cloud and by applications running on local systems. Windows Azure also supports applications built on the .NET Framework and other ordinary languages supported in Windows systems, like C\# , Visual Basic, C++, and others. Windows Azure supports general-purpose programs, rather than a single class of computing. Developers can create web applications using technologies such as ASP.NET and Windows Communication Foundation (WCF), applications that run as independent background processes, or applications that combine the two. Windows Azure allows storing data in blobs, tables, and queues, all accessed in a RESTful style via HTTP or HTTPS \citep{Reference5}.
%
%\textbf{Azure SQL Database:} Microsoft Windows Azure SQL Database is a cloud-based relational database platform built on SQL Server technologies. Any company can deploys relational database solutions to the cloud, and take advantage of a distributed data center that provides  availability and scalability. Azure SQL Database allows users to make relational queries against stored data, which can either be structured or semi-structured, or even unstructured documents. Azure SQL Database is built on Windows Server and SQL Server technologies. When developers create on-premise applications that use SQL Server, they use client libraries that use the tabular data stream (TDS) protocol to communicate between client and server. Windows Azure SQL Database provides the same TDS interface as SQL Server so that developers can use the same tools and libraries to build client applications for data that is stored in Azure SQL Database \citep{Reference10}. 
%
%\textbf{.NET services:} Offer distributed infrastructure services to cloud-based and local applications. The .NET Services facilitate the creation of distributed applications. The Access Control component provides a cloud-based implementation of single identity verification across applications and companies.
%
%\subsection{Google App Engine} Google App Engine is a web application hosting service. App Engine can serve traditional website content, such as documents and images, but the environment is especially designed for real-time dynamic applications.
%Applications written for App Engine scale automatically. As more people use the application, App Engine allocates more resources for the application and manages the use of those resources. The application itself does not need to know anything about the resources it is using. Currently, Google App Engine supports Java, Python, PHP, and Go \citep{Reference11}. Different framework are also supported for Java, Python and Go such as Spring MVC (Java) and Django (Python) \citep{Reference11}.

%----------------------------------------------------------------------------------------
